<?php
/* @var $this GroupController */
/* @var $model Group */
/* @var $form CActiveForm */
?>

<style>
    input[type="text"] {
        padding: 4px 0;
        width: 500px;
    }
    textarea{
        padding: 4px 0;
        width: 500px;
    }
    div.buttons{
        background-image: url("/easyui/images/linkbutton_bg.png");
        background-position: right 0;
        background-repeat: no-repeat;
        border-radius: 5px 5px 5px 5px;
        color: #444444;
        cursor: pointer;
        display: inline-block;
        float: right;
        font-size: 12px;
        height: 24px;
        outline: medium none;
        padding-right: 18px;
        text-decoration: none;
        float: left;
    }
    input[type="submit"]{
        background: url("/easyui/images/button_span_bg.gif") no-repeat scroll left top transparent;
        display: inline-block;
        height: 24px;
        line-height: 24px;
        padding: 1px 0 4px 18px;
        border: 0;
        vertical-align: middle;
    }
</style>

<div class="form" style="width: 98%;margin: 0 auto;border: 1px solid #99BBE8;padding: 20px;">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'group-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>255,'style'=>'width:200px;')); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

    <div class="row">
        <label for="Group_name">包含用户</label>
        <?php
            $ug =UserGroup::model()->findAllByAttributes(array('gid'=>$model->id));
            foreach($ug as $ug_one){
                $u = User::model()->findByPk($ug_one->uid);
                echo '<span style="border:1px solid #99CC33;padding:4px;">'.$u->username.'</span>&nbsp;&nbsp;';
            }
        ?>
    </div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '创建' : '保存'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->